home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
comms
/
reglw2os.arj
/
HOST.SCR
< prev
next >
Wrap
Text File
|
1993-07-30
|
17KB
|
698 lines
**
** LiveWire 2.0a Host Mode
**
** Written by Les Novell 1991
**
** You may modify this script file to meed your needs
**
Set TimeOut=60
OnTimeOut UserHungUp
** Current User Information
String Name=""
String Password=""
String Address1=""
String Address2=""
String PhoneNumber=""
String Age=""
** Host Mode Configuration Information
String MessageDir=".\MESSAGES"
String FileDir="."
String SysopPassword="PASSWORD"
Int MaxTime=60
Int LockPort=0
** Events Used By The Host
Integer LookForRing=0
Integer OnHangup=0
Integer LookForLocal=0
** Global Variables
String FileToDisplay=""
String LogonName=""
String LogonPassword=""
Integer WinUp=0
:StartHost
Log "Host Mode Initiated"
Window 1,1,80,24
FgBg 0,7
ClrScr
Window 1,1,80,23
FgBg 15,0
ClrScr
Box 5,5,60,14,"LiveWire Host / ESC to quit",1
Set WinUp=1
Set LocalOnly=0
Event OnHangup Offline UserHungUp
Goto InitVideo
NotExist "HOST.CFG" MakeConfig
NotExist "HOST.USR" MakeUserList
Goto ReadConfigFile
MkDir MessageDir
MkDir FileDir
Equal Param=1 DetectedLocal
Goto SetUpEvents
Log "Awaiting a caller"
:WaitForEvent
Wait 1
Goto WaitForEvent
Halt
:Logon
Integer UserFile
KillBox
Set WinUp=0
EchoBack 1
Set FileToDisplay="WELCOME"
Goto DiseFile
:GetLogonName
Set LogonName=""
Dise \n "Enter your full name > "
Get LogonName,40
Equal LogonName="" GetLogonName
Open "HOST.USR",UserFile
:ReadUserRecord
ReadLn UserFile,Name
ReadLn UserFile,Password
ReadLn UserFile,Address1
ReadLn UserFile,Address2
ReadLn UserFile,PhoneNumber
ReadLn UserFile,Age
IfEof UserFile MustBeNewUser
NotEqual Name=LogonName ReadUserRecord
Close UserFile
Window 1,1,80,24
GotoXY 1,24
FgBg 0,7
Disp "░ LiveWire HOST MODE ░ " Name " ░ " Password " ░ " PhoneNumber " ░ " Age " ░"
FgBg 7,0
Window 1,1,80,23
GotoXY 1,20
Log "User Called"
Log Name
Equal Password="" MainMenu
:GetLogonPassword
Set LogonPassword=""
Dise \n "Enter your password > "
EchoBack 0
Get LogonPassword,40
EchoBack 1
NotEqual Password=LogonPassword GetLogonPassword
Goto MainMenu
:MustBeNewUser
Log "New User Validated"
Set Name=LogonName
Set FileToDisplay="NEWUSER"
Goto DiseFile
Set PhoneNumber=""
Set Address1=""
Set Address2=""
Set Age=""
Dise \n "Please fill out the following information for our records:" \n
Dise "Phone Number : "
Get PhoneNumber,40
Dise \n "Street Address : "
Get Address1,70
Dise \n "City, State & ZIP : "
Get Address2,70
Dise \n "Age : "
Get Age,3
Dise \n \n "You must now enter a password for your account on this system." \n
Dise "If you do not wish to have a password, just press ENTER." \n
String Retry
:EnterPassword
Set Password=""
Set Retry=""
Dise \n "Password : "
Get Password,30
Dise \n "Re-enter your password for verification : "
Get Retry,30
NotEqual Retry=Password EnterPassword
Dise \n \n "Thank you..."
Window 1,1,80,24
GotoXY 1,24
FgBg 0,7
Disp "░ LiveWire HOST MODE ░ " Name " ░ " Password " ░ " PhoneNumber " ░ " Age " ░"
FgBg 7,0
Window 1,1,80,23
GotoXY 1,20
Open "HOST.USR",UserFile
GoEof UserFile
Write UserFile,Name \n
Write UserFile,Password \n
Write UserFile,Address1 \n
Write UserFile,Address2 \n
Write UserFile,PhoneNumber \n
Write UserFile,Age \n
Close UserFile
:MainMenu
String Option=""
Set FileToDisplay="MAINMENU"
Goto DiseFile
Dise "Select a function: "
GetKey Option
Dise \n
Equal Option="H" EndLogon
Equal Option="F" ShowFiles
Equal Option="U" UploadFile
Equal Option="D" DownloadFile
Equal Option="P" PageSysop
Equal Option="R" ReadMessages
Equal Option="S" SendMessage
Equal Option="O" OperatorFuncs
Destroy Option
Goto MainMenu
:EndLogon
Log "User Hung Up Normally"
Dise \n \n "Thank you for calling... (click)" \n \n
EchoBack 0
Delay 250
HangUp
Destroy UserFile
Goto StartHost
::OperatorFuncs
String OpPswd=""
String OpOption=""
Dise \n \n "Enter system operator password: "
EchoBack 0
Get OpPswd,40
EchoBack 1
NotEqual OpPswd=SysopPassword RetOpFuncs
Log "User Entered Sysop Operations"
:OpMenu
Dise "" \n \n "System Operator Functions" \n \n
Dise "1. Change Message Directory : " MessageDir \n
Dise "2. Change File Directory : " FileDir \n
Dise "3. Locked Baud Rate (0=No) : " LockPort \n
Dise "4. Change Sysop Password : " SysopPassword \n
Dise "S Save these options" \n
Dise "Q Quit without saving" \n \n
Dise "Select option: "
GetKey OpOption
Dise \n
Equal OpOption="1" OpGetMsgDir
Equal OpOption="2" OpGetFileDir
Equal OpOption="3" OpGetLockPort
Equal OpOption="4" OpGetPassword
Equal OpOption="S" OpSaveConfig
Equal OpOption="Q" OPQuitConfig
Goto OpMenu
:OpGetMsgDir
Dise "Edit message directory (DO NOT END WITH A BACKSLASH)" \n
Dise "> "
Get MessageDir,70
Goto OpMenu
:OpGetFileDir
Dise "Edit files directory (DO NOT END WITH A BACKSLASH)" \n
Dise "> "
Get FileDir,70
Goto OpMenu
:OpGetMaxTime
Dise "Edit maximum time for each user" \n
Dise "> "
Get MaxTime,70
Goto OpMenu
:OpGetLockPort
Dise "Edit locked baud rate (1=on 0=off)" \n
Dise "> "
Get LockPort,3
Goto OpMenu
:OpGetPassword
Dise "Edit sysop password" \n
Dise "> "
Get SysopPassword,70
Goto OpMenu
:OpSaveConfig
Dise "Saving..."
Goto MakeConfig
Dise \n \n
Goto RetOpFuncs
:OpQuitConfig
Goto ReadConfigFile
Dise \n \n
Goto RetOpFuncs
:RetOpFuncs
Destroy OpPswd
Destroy OpOption
Ret
::SendMessage
Integer MsgFile
Integer MaxMessage=1
Integer ThisMessage=1
Integer LineNo=1
String MsgFileName
String MsgLine
String MsgOption
Log "User Wrote a message"
NotExist "HOST.MSG" WriteMessage
Open "HOST.MSG",MsgFile
Read MsgFile,MaxMessage
Close MsgFile
Inc MaxMessage
Set ThisMessage=MaxMessage
:WriteMessage
Set MsgFileName=MessageDir
Cat MsgFileName,"\MESSAGE.",MsgFileName
Cat MsgFileName,ThisMessage,MsgFileName
Open MsgFileName,MsgFile
Dise \n \n "Enter your message"
Dise \n "End your message by placing a period (.) alone on the last line" \n
Dise "----------------------------------------------------------------------------" \n
Write MsgFile,"------------------------------" \n
Write MsgFile," Message #" ThisMessage \n
Write MsgFile," From :" Name \n
Write MsgFile,"------------------------------" \n
Write MsgFile, \n
:GetNextMsgLine
Dise LineNo "> "
Set MsgLine=""
Get MsgLine,75
Dise \n
Equal MsgLine="." EndMessage
Write MsgFile,MsgLine \n
Inc LineNo
Goto GetNextMsgLine
:EndMessage
Dise \n "Message Ended" \n
Dise "[S]ave Message [C]ontinue Message [A]bort Message : "
GetKey MsgOption
Dise \n
Equal MsgOption="S" SaveMessage
Equal MsgOption="C" GetNextMsgLine
Equal MsgOption="A" AbortMessage
Goto EndMessage
:SaveMessage
Write MsgFile,"------------------------------" \n
Close MsgFile
DosCmnd "Erase HOST.MSG"
Open "HOST.MSG",MsgFile
Write MsgFile,ThisMessage
Close MsgFile
Goto RetSendMessage
:AbortMessage
String DoDos="ERASE "
Cat DoDos,MsgFileName,DoDos
DoCmnd DoDos
Goto RetSendMessage
:RetSendMessage
Destroy MsgFile
Destroy MaxMessage
Destroy ThisMessage
Destroy LineNo
Destroy MsgFileName
Destroy MsgLine
Destroy MsgOption
Ret
::ReadMessages
Integer MsgFile
Integer MaxMessage=1
Integer ThisMessage=1
String MsgFileName
String MsgOption
Log "User Read Messages"
NotExist "HOST.MSG" RetReadMessages
Open "HOST.MSG",MsgFile
Read MsgFile,MaxMessage
Close MsgFile
Dise \n "Messages range from 1 to " MaxMessage \n
Dise "Enter message to start reading at : "
Get ThisMessage,3
Dise \n
:DisplayMessage
Set MsgFileName=MessageDir
Cat MsgFileName,"\MESSAGE.",MsgFileName
Cat MsgFileName,ThisMessage,MsgFileName
NotExist MsgFileName SkipToNextMsg
Set FileToDisplay=MsgFileName
Goto DiseFile
Dise \n "[ENTER] for next message or [Q] to quit : "
GetKey MsgOption
Dise \n
Equal MsgOption="Q" RetReadMsg
:SkipToNextMsg
Inc ThisMessage
Greater ThisMessage,MaxMessage RetReadMessages
Goto DisplayMessage
:RetReadMessages
Dise \n "Sorry, there are no more messages..." \n
Wait 2
:RetReadMsg
Destroy MsgFile
Destroy MaxMessage
Destroy ThisMessage
Destroy MsgFileName
Destroy MsgOption
Ret
::PageSysop
String Key
Log "User Attempted To Page Sysop"
Dise \n \n "Paging operator, press Q to abort..." \n
Disp "SYSOP: Press 'C' to chat" \n
:RepeatPage
Disp ""
Set Key=""
GetKey Key
Equal Key="Q" EndPage
NotEqual Key="C" RepeatPage
Dise \n \n " You are now in chat mode" \n
Disp " SYSOP: Type ~ on a blank line to end chat mode"
Dise \n \n
Log "Sysop Answered Chat Request"
:RepeatChatInput
Set Key=""
Dise " "
Get Key,77
Dise \n
NotEqual Key="~" RepeatChatInput
:EndPage
Destroy Key
Ret
::UploadFile
String ULProtocol=""
String ULFile=""
String ULFile2=""
Set FileToDisplay="PROT"
Goto DiseFile
Dise "Select protocol: "
GetKey ULProtocol
Dise \n \n "Name of file you are uploading: "
Get ULFile,13
Equal ULFile=" " RetUploadFile
Dise \n
Cat ULFile2,FileDir,ULFile2
Cat ULFile2,"\",ULFile2
Cat ULFile2,ULFile,ULFile2
ReceiveFile ULProtocol,ULFile2
Log "User Uploaded A File"
::RetUploadFile
Destroy ULProtocol
Destroy ULFile
Destroy ULFile2
Ret
::DownloadFile
String DLProtocol=""
String DLFile=""
String DLFile2=""
Set FileToDisplay="PROT"
Goto DiseFile
Dise "Select protocol: "
GetKey DLProtocol
Dise \n \n "Name of file you are downloading: "
Get DLFile,13
Equal ULFile="" RetDownloadFile
Dise \n
Cat DLFile2,FileDir,DLFile2
Cat DLFile2,"\",DLFile2
Cat DLFile2,DLFile,DLFile2
NotExist DLFile2 DLNotExist
SendFile DLProtocol,DLFile2
Log "User Downloaded a file"
:RetDownloadFile
Destroy DLProtocol
Destroy DLFile
Destroy DLFile2
Ret
:DLNotExist
Dise \n \n "That file does not exist!" \n
Wait 2
Goto RetDownloadFile
::ShowFiles
String Command="DIR "
Cat Command,FileDir,Command
Cat Command," >host.out",Command
DOSCMND Command
Dise \n \n
Set FileToDisplay="host.out"
Goto DiseFile
Dise \n "Press [ENTER]"
GetKey Command
Destroy Command
Ret
::DiseFile
Integer DispFile
String DispLine
Open FileToDisplay,DispFile
:DF_ReadNextLine
ReadLn DispFile,DispLine
IfEof DispFile DF_CloseFile
Dise DispLine \n
Goto DF_ReadNextLine
:DF_CloseFile
Close DispFile
Destroy DispFile
Destroy DispLine
Ret
:UserHungUp
Kill OnHangup
HangUp
Goto StartHost
::SetUpEvents
Disp " Waiting for the phone to ring..." \n
Event LookForLocal Find "LOCAL",DetectedLocal
Event LookForRing Find "RING",DetectedRing
Ret
:DetectedLocal
Set LocalOnly=1
KillEvent DetectedLocal
KillEvent LookForRing
Disp \n " Initiating local mode operation" \n
Goto Logon
:DetectedRing
Integer Connect
Integer Connect1200
Integer Connect2400
Integer Connect4800
Integer Connect9600
Integer Connect19200
Integer Connect38400
Integer NoCarrier
Long ConnectRate
KillEvent DetectedLocal
KillEvent LookForRing
Log "Detected Phone Ringing"
Disp \n " Answering Phone" \n
Set Pace=50
Send "ATA" \n
Set Pace=0
Event Connect1200 Find "CONNECT 1200",Connect1200
Event Connect2400 Find "CONNECT 2400",Connect2400
Event Connect4800 Find "CONNECT 4800",Connect4800
Event Connect9600 Find "CONNECT 9600",Connect9600
Event Connect19200 Find "CONNECT 19200",Connect19200
Event Connect38400 Find "CONNECT 38400",Connect38400
Event Connect Find "CONNECT^M",Connect
Event NoCarrier Find "NO CARRIER^M",NoCarrier
:WaitConnectEvent
Wait 1
Goto WaitConnectEvent
:NoCarrier
KillEvent Connect1200
KillEvent Connect2400
KillEvent Connect4800
KillEvent Connect9600
KillEvent Connect19200
KillEvent Connect38400
KillEvent Connect
KillEvent NoCarrier
Destroy Connect1200
Destroy Connect2400
Destroy Connect4800
Destroy Connect9600
Destroy Connect19200
Destroy Connect38400
Destroy Connect
Destroy NoCarrier
Destroy ConnectRate
Goto StartHost
:Connect
Log "Connect 300"
Set ConnectRate=300
Goto SetBaudRate
:Connect1200
Log "Connect 1200"
Set ConnectRate=1200
Goto SetBaudRate
:Connect2400
Log "Connect 2400"
Set ConnectRate=2400
Goto SetBaudRate
:Connect9600
Log "Connect 9600"
Set ConnectRate=9600
Goto SetBaudRate
:Connect19200
Log "Connect 19200"
Set ConnectRate=19200
Goto SetBaudRate
:Connect38400
Log "Connect 38400"
Set ConnectRate=38400
Goto SetBaudRate
:SetBaudRate
Equal LockPort 1 SkipBaudSet
SetBaud ConnectRate
:SkipBaudSet
KillEvent Connect1200
KillEvent Connect2400
KillEvent Connect4800
KillEvent Connect9600
KillEvent Connect19200
KillEvent Connect38400
KillEvent Connect
KillEvent NoCarrier
Destroy Connect1200
Destroy Connect2400
Destroy Connect4800
Destroy Connect9600
Destroy Connect19200
Destroy Connect38400
Destroy Connect
Destroy NoCarrier
Destroy ConnectRate
Goto Logon
::ReadConfigFile
Integer ConfigFile
Log "Read Configuration File"
Disp " Reading configuration file..."
Open "HOST.CFG" ConfigFile
ReadLn ConfigFile MessageDir
ReadLn ConfigFile FileDir
ReadLn ConfigFile SysopPassword
Read ConfigFile MaxTime
Read ConfigFile LockPort
Close ConfigFile
Destroy ConfigFile
Disp "OK" \n
Ret
::MakeConfig
Integer ConfigFile
Log "Created Configuration File"
Disp " Creating configuration file..."
DosCmnd "Erase HOST.CFG"
Open "HOST.CFG" ConfigFile
Write ConfigFile MessageDir \n
Write ConfigFile FileDir \n
Write ConfigFile SysopPassword \n
Write ConfigFile MaxTime \n
Write ConfigFile LockPort \n
Close ConfigFile
Destroy ConfigFile
Disp "OK" \n
Ret
::MakeUserList
Integer UserFile
Log "Created User File"
Disp " Creating user list file..."
Open "HOST.USR",UserFile
Close UserFile
Destroy UserFile
Disp "OK" \n
Ret
::InitVideo
FgBg 15,0
ClrScr
Disp " LiveWire 2.0 Host Mode" \n \n
FgBg 7,0
Ret
:CleanUpScript
Equal WinUp=1 KillLastBox
Window 1,1,80,24
ClrScr
Disp "LiveWire 2.0 Host Mode Stopped" \n \n
Halt
::KillLastBox
KillBox
Ret